package cn.zk.commom.tcp.obd;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import org.springframework.stereotype.Component;


@Component
public class ObdServerChannelInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel channel) throws Exception {
        channel.pipeline().addLast("decoder", new ObdDecoder());
        channel.pipeline().addLast("encoder", new ObdEncoder());
        channel.pipeline().addLast(new ObdServerHandler());
    }
}
